package com.wzy.netty.core.inboundhandlerandoutboundhandler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * 描述  : 注意编码器的顺序顺序
 * 创建人:    Wzy
 * 创建时间: 2020-06-11  23:06
 */
public class MyClientInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        ChannelPipeline pipeline = socketChannel.pipeline();
        // pipeline.addLast(new MyByteToLongDecoder());
        pipeline.addLast(new MyByteToLongDecoder2());
        //出栈编码
        pipeline.addLast(new MyLongToByteEncoder());
        //自定义handler 完成业务
        pipeline.addLast(new MyClientHandel());

    }
}
